<template>
  <div class="demo">
    <h2 class="name">学生姓名：{{ name }}</h2>
    <h2>学生性别：{{ sex }}</h2>
    <button @click="hello">hello</button>
  </div>
</template>

<script>
export default {
  name: "Student",
  data() {
    return {
      name: "张三123456",
      sex: "男",
    };
  },
  methods: {
    hello() {
      this.$bus.$emit("hello", 666);
    },
  },
};
</script>

<style scoped lang="less">
.demo {
  background-color: plum;
  color: white;
  .name {
    font-size: 50px;
    color: palegreen;
  }
}
</style>
